#ifndef BSP_I2C_H
#define BSP_I2C_H
#include "hc32_ddl.h"
#include "bsp_i2c_porting.h"

#ifdef __cplusplus
extern "C" {
#endif

extern void bsp_I2C1_Port_Init(void);
extern uint8_t bsp_I2C_Init(M4_I2C_TypeDef* pstcI2Cx,uint32_t baudrate);
extern uint8_t I2C_Write_data(M4_I2C_TypeDef* pstcI2Cx,uint8_t DeviceAddr,uint8_t *addr, uint8_t addrsize, const uint8_t *data, uint16_t len);
extern uint8_t I2C_Read_data(M4_I2C_TypeDef* pstcI2Cx,uint8_t DeviceAddr,uint8_t *addr, uint8_t addrsize, uint8_t *data, uint16_t len);	
extern uint8_t I2C_Write_Buffer(M4_I2C_TypeDef* pstcI2Cx,uint8_t DeviceAddr,const uint8_t *data, uint16_t len);	
extern uint8_t I2C_Read_Buffer(M4_I2C_TypeDef* pstcI2Cx,uint8_t DeviceAddr, uint8_t *data, uint16_t len);
extern uint8_t bsp_i2c_resetbus(M4_I2C_TypeDef* pstcI2Cx);	

#ifdef __cplusplus
};
#endif

#endif
